/*
 * -----------------------------------------------------------------------------
 * Project  : ODBC Support
 * Purpose  : Support ODBC connectivity.
 * File     : Win32.Data.DataSource.h
 * Author   : Eduardo Sobrino
 * Date     : Nov/98
 */

#pragma once

// -----------------------------------------------------------------------------

#include "Win32.String.h"

namespace Kif
{
namespace Win32
{
namespace Data
{

enum CommandType
{
   Command_Query = 1,
   Command_StoredProcedure = 2
}  ;  // end of CommandType

enum AuthenticationMethod
{
   Authentication_NT  = 1,
   Authentication_SQL = 2
}  ;  // end of AuthenticationMethod

class DataSourceInfo
{
private:
public:

   Kif::Win32::String SourceName;
   Kif::Win32::String Catalog;
   Kif::Win32::String UserId;
   Kif::Win32::String Password;

   AuthenticationMethod AuthenticationOption;

   DataSourceInfo()
   {
      AuthenticationOption = Authentication_NT;
   }

   void SetSourceName(TCHAR *sourceName)
   {
      SourceName.Copy(sourceName);
   }

   void SetCatalog(TCHAR *catalog)
   {
      Catalog.Copy(catalog);
   }

   void SetUserId(TCHAR *userId)
   {
      UserId.Copy(userId);
   }

   void SetPassword(TCHAR *password)
   {
      Password.Copy(password);
   }

   void Copy(DataSourceInfo &DataSource)
   {
      SourceName.Copy(DataSource.SourceName);
      Catalog.Copy(DataSource.Catalog);
      UserId.Copy(DataSource.UserId);
      Password.Copy(DataSource.Password);

      AuthenticationOption = DataSource.AuthenticationOption;
   }  // end of DataSourceInfo

}  ;  // end of DataSource

}
}
}
